package metar_taf;

public class Airport {
	private String ICAO;
	private String name;
	private Location location;
	double distance = -1;
	
	public Airport(String ICAO, String name, double longitude, double latitude) {
		this.ICAO = ICAO;
		this.name = name;
		location = new Location(latitude, longitude);
	}
	
	public String toJSON() {
		return "{" +
					"\"ICAO\" : \"" 		+ ICAO + "\", " +
					"\"name\" : \"" 		+ name + "\", " +
					"\"latitude\" : " 	+ location.getLatitude() + ", " +
					"\"longitude\" : " 	+ location.getLongitude() + ", " +
					"\"distance\" : " 	+ distance +
				"}";
	}

	public final String getICAO() {
		return ICAO;
	}

	public final void setICAO(String ICAN) {
		this.ICAO = ICAN;
	}

	public final String getName() {
		return name;
	}

	public final void setName(String name) {
		this.name = name;
	}

	public final Location getLocation() {
		return location;
	}

	public final void setLocation(Location location) {
		this.location = location;
	}
	
}
